/*
 * @Description:
 * @Author: 小何
 * @Date: 2021-10-10 13:47:51
 * @LastEditTime: 2021-10-10 18:47:48
 * @LastEditors:
 */
const router = require("koa-router")();
const connection = require("../config/database");

router.get("/data/year", async (ctx, next) => {
  const sql = `SELECT * FROM title`;
  const res = await connection.execute(sql);
  ctx.body = {
    code: 200,
    data: {
      list: res[0],
    },
  };
});

module.exports = router;
